package org.example.exceptin;

/**
 * @BelongsProject: Dynamic-relationship-binding
 * @BelongsPackage: org.example.exceptin
 * @Author: dengxiyan
 * @CreateTime: 2025/07/04  11:13
 * @Description: TODO
 * @Version: 1.0
 */
public class EntityNotFoundException extends RuntimeException {
    public EntityNotFoundException(String message) {
        super(message);
    }


    public static EntityNotFoundException forId(Class<?> entityClass, Long id) {
        return new EntityNotFoundException(
                String.format("找不到ID为 %d 的 %s 实体", id, entityClass.getSimpleName())
        );
    }
}
